﻿package test.ui {
	import gear.core.Game;
	import gear.net.AssetData;
	import gear.net.LibData;
	import gear.net.RESManager;
	import gear.net.SWFLoader;
	import gear.ui.controls.GButton;
	import gear.ui.data.GButtonData;

	import flash.events.Event;

	/**
	 * TestBDButton 测试位图按钮
	 * 
	 * @author bright
	 * @version 20101022
	 */
	[SWF(width=550,height=400,backgroundColor=0x333333,frameRate=48)]
	public class TestGButton extends Game {
		override protected function startup() : void {
			_res.add(new SWFLoader(new LibData("assets/ui.swf")));
			_res.addEventListener(Event.COMPLETE, completeHandler);
			_res.load();
		}

		private function completeHandler(event : Event) : void {
			var data : GButtonData = new GButtonData();
			data.bindTo(RESManager.getMC(new AssetData("testButton")));
			var btn : GButton = new GButton(data);
			btn.text = "Test";
			addChild(btn);
		}

		public function TestGButton() {
			super();
		}
	}
}
